import 'package:enya_app_upgrade/app_info.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'enya_app_upgrade_method_channel.dart';

abstract class EnyaAppUpgradePlatform extends PlatformInterface {
  /// Constructs a EnyaAppUpgradePlatform.
  EnyaAppUpgradePlatform() : super(token: _token);

  static final Object _token = Object();

  static EnyaAppUpgradePlatform _instance = MethodChannelEnyaAppUpgrade();

  /// The default instance of [EnyaAppUpgradePlatform] to use.
  ///
  /// Defaults to [MethodChannelEnyaAppUpgrade].
  static EnyaAppUpgradePlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [EnyaAppUpgradePlatform] when
  /// they register themselves.
  static set instance(EnyaAppUpgradePlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<AppInfo> getAppInfo() {
    throw UnimplementedError('getAppInfo() has not been implemented.');
  }

  Future<void> toAppStore(String appId) {
    throw UnimplementedError('toAppStore() has not been implemented.');
  }

  Future<String> getApkDownloadPath(String version) {
    throw UnimplementedError('getApkDownloadPath() has not been implemented.');
  }

  Future<void> installAppForAndroid(String path) {
    throw UnimplementedError(
        'installAppForAndroid() has not been implemented.');
  }
}
